import requests
import pytest
from send.send_req import Send_req
from utils.yaml_utils import read_yaml
class Test_buy:



    @pytest.mark.parametrize("args" ,  read_yaml("./data/buy.yaml")  )
    def test_buy(self,args):

        session = requests.session()

        send =  Send_req()

        send.send_login(session,args["username"],args["password"])

        result = send.send_buy(session,args["id"],args["uid"],args["pwd"])

        assert  result["code"] == 200  and result["body"]["code"] == args["exp"]

